//
//  CPAudioPlayer.h
//  GHTestWebViewDemo
//
//  Created by collegepre on 16/9/18.
//  Copyright © 2016年 张冠华. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

// 将要播放
typedef void(^CPAudioPlayerStopPlayBlock)();

@interface CPAudioPlayer : NSObject

@property (nonatomic, strong) AVAudioPlayer *player;
//SingletonH(CPAudioTool)

@property (nonatomic, copy) void(^downloadSuccess)(void);

@property (nonatomic, copy) void(^playComplete)(BOOL suc);

@property (nonatomic, copy) void(^dragProgressComplete)(double progress);

@property (nonatomic, copy) CPAudioPlayerStopPlayBlock stopPlayCallback;

@property (nonatomic, copy) NSString *audioPath;

#pragma mark 是否正在录音
- (BOOL)isPlaying;

#pragma mark - 是否正在暂停播放
@property (nonatomic, assign) BOOL isPausePlaying;

#pragma mark 开始播放
- (void)continuePlaying;
- (void)startPlayingWithName:(NSString *)filePath;

#pragma mark 停止播放
- (void)stopPlaying;

#pragma mark 暂停播放
- (void)pausePlaying;

#pragma mark 开始播放
//- (void)startPlaying;
- (void)startPlayingWithName:(NSString *)filePath block:(void (^)())completion;

- (void)startPlayingWithName:(NSString *)filePath numberOfLoops:(NSInteger)loops block:(void (^)())completion;

- (void)startPlayPlaySystemSoundWithURLPath:(NSString *)soundPath;

#pragma mark 停止播放
- (void)stopPlayingBlock:(void (^)())completion;

#pragma mark 暂停播放
- (void)pausePlayingBlock:(void (^)())completion;

@end
